package com.zk.erp.controller;

import com.zk.erp.entity.JsonResult;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice
public class MyControllerExceptionHandler {
    @ResponseBody
    @ExceptionHandler(Exception.class)
    public JsonResult handleException(Exception e){
        return new JsonResult(0,e.getMessage());
    }
}
